/*
Test Case: DepartmentTests
Author: Kyle Hawkins

*/

package norm.reference

import grails.test.*

class DepartmentTests extends GrailsUnitTestCase {

	def department
    protected void setUp() {
        super.setUp()
		def division = new Division(divisionCode:"PGS", divisionName:"Professional and Graduate Studies")
		department = new Department(departmentCode:"CSC", departmentName:"Computer Science", division:division)
	}

    protected void tearDown() {
        super.tearDown()
    }

    void testConstructor(){
		assertEquals("CSC", department.departmentCode)
		assertEquals("Computer Science", department.departmentName)
    }
	
	void testToString(){
		assertEquals("CSC", department.toString())
	}
	
	void testRelationship(){
		assertEquals("PGS", department.division.divisionCode)
		assertEquals("Professional and Graduate Studies", department.division.divisionName)
	}
}
